package com.zhiwei.fast.fragments

import android.Manifest
import android.os.Bundle
import com.blankj.utilcode.constant.PermissionConstants
import com.blankj.utilcode.util.PermissionUtils
import com.zhiwei.fast.databinding.FragmentBleScantBinding
import com.zhiwei.fast.fragments.models.BleScantViewModel
import com.zhiwei.most.base.fragment.BaseVmVbFragment
import com.zhiwei.most.ext.onClickRxView

/**
 * Create by zhiweizhu on 2022/3/3
 */
class BleScantFragment : BaseVmVbFragment<BleScantViewModel, FragmentBleScantBinding>() {

    override fun initView(savedInstanceState: Bundle?) {
        with(mViewBind) {
            start.onClickRxView {
                mViewModel.startScant()
            }

            stop.onClickRxView {
                mViewModel.stopScant()
            }
        }
    }

    override fun lazyLoadData() {
        PermissionUtils.permissionGroup(PermissionConstants.LOCATION)
            .callback { isAllGranted, granted,
                        deniedForever, denied ->

            }.request()
    }

    override fun createObserver() {

    }
}